home *** CD-ROM | disk | FTP | other *** search
/ Java 1996 August / Java - Summer 1996.iso / kaffe-0.2 / config / i386-kaffe.def < prev    next >
Encoding:
Text File  |  1996-02-13  |  18.2 KB  |  1,413 lines

  1. # =================================================================
  2. # Kaffe virtual machine for the i386
  3. # =================================================================
  4. #
  5. # Copyright (c) 1996 Systems Architecture Research Centre,
  6. #           City University, London, UK.
  7. #
  8. # See the file "license.terms" for information on usage and redistribution
  9. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  10. #
  11. # Written by Tim Wilkinson <tim@sarc.city.ac.uk>, February 1996.
  12.  
  13. insn NOP(in=none; out=none) = 0
  14. {
  15. }
  16.  
  17. insn ACONST_NULL(in=none; out=objref) = 1
  18. {
  19.     movl 0,O1
  20. }
  21.  
  22. insn ICONST_M1(in=none; out=int) = 2
  23. {
  24.     movl -1,O1
  25. }
  26.  
  27. insn ICONST_0(in=none; out=int) = 3
  28. {
  29.     movl 0,O1
  30. }
  31.  
  32. insn ICONST_1(in=none; out=int) = 4
  33. {
  34.     movl 1,O1
  35. }
  36.  
  37. insn ICONST_2(in=none; out=int) = 5
  38. {
  39.     movl 2,O1
  40. }
  41.  
  42. insn ICONST_3(in=none; out=int) = 6
  43. {
  44.     movl 3,O1
  45. }
  46.  
  47. insn ICONST_4(in=none; out=int) = 7
  48. {
  49.     movl 4,O1
  50. }
  51.  
  52. insn ICONST_5(in=none; out=int) = 8
  53. {
  54.     movl 5,O1
  55. }
  56.  
  57. insn LCONST_0(in=none; out=long) = 9
  58. {
  59.     movl 0,O2 
  60.     movl 0,O1
  61. }
  62.  
  63. insn LCONST_1(in=none; out=long) = 10
  64. {
  65.     movl 0,O2
  66.     movl 1,O1 
  67. }
  68.  
  69. insn FCONST_0(in=none; out=float) = 11
  70. {
  71.     movl 0,O1
  72. }
  73.  
  74. insn FCONST_1(in=none; out=float) = 12
  75. {
  76.     movl 0x3f800000,O1
  77. }
  78.  
  79. insn FCONST_2(in=none; out=float) = 13
  80. {
  81.     movl 0x40000000,O1
  82. }
  83.  
  84. insn DCONST_0(in=none; out=double) = 14
  85. {
  86.     movl 0,O2 
  87.     movl 0,O1
  88. }
  89.  
  90. insn DCONST_1(in=none; out=double) = 15
  91. {
  92.     movl 0,O2
  93.     movl 0x3ff00000,O1
  94. }
  95.  
  96. insn BIPUSH(in=none; out=int) = 16
  97. {
  98.     movl V1,O1
  99. }
  100.  
  101. insn SIPUSH(in=none; out=int) = 17
  102. {
  103.     movl V1,O1
  104. }
  105.  
  106. insn LDC1(in=none; out=any) = 18
  107. {
  108.     movl C1,O1
  109. }
  110.  
  111. insn LDC2(in=none; out=any) = 19
  112. {
  113.     movl C1,O1
  114. }
  115.  
  116. insn LDC2W(in=none; out=any,any) = 20
  117. {
  118.     movl C2,O2
  119.     movl C1,O1 
  120. }
  121.  
  122. insn ILOAD(in=none; out=int) = 21
  123. {
  124.     movl L1,O1
  125. }
  126.  
  127. insn LLOAD(in=none; out=long) = 22
  128. {
  129.     movl L1,O2
  130.     movl L2,O1 
  131. }
  132.  
  133. insn FLOAD(in=none; out=float) = 23
  134. {
  135.     movl L1,O1
  136. }
  137.  
  138. insn DLOAD(in=none; out=double) = 24
  139. {
  140.     movl L1,O2
  141.     movl L2,O1 
  142. }
  143.  
  144. insn ALOAD(in=none; out=objref) = 25
  145. {
  146.     movl L1,O1
  147. }
  148.  
  149. insn ILOAD_0(in=none; out=int) = 26
  150. {
  151.     movl L1,O1
  152. }
  153.  
  154. insn ILOAD_1(in=none; out=int) = 27
  155. {
  156.     movl L1,O1
  157. }
  158.  
  159. insn ILOAD_2(in=none; out=int) = 28
  160. {
  161.     movl L1,O1
  162. }
  163.  
  164. insn ILOAD_3(in=none; out=int) = 29
  165. {
  166.     movl L1,O1
  167. }
  168.  
  169. insn LLOAD_0(in=none; out=long) = 30
  170. {
  171.     movl L1,O2 
  172.     movl L2,O1
  173. }
  174.  
  175. insn LLOAD_1(in=none; out=long) = 31
  176. {
  177.     movl L1,O2 
  178.     movl L2,O1
  179. }
  180.  
  181. insn LLOAD_2(in=none; out=long) = 32
  182. {
  183.     movl L1,O2 
  184.     movl L2,O1
  185. }
  186.  
  187. insn LLOAD_3(in=none; out=long) = 33
  188. {
  189.     movl L1,O2 
  190.     movl L2,O1
  191. }
  192.  
  193. insn FLOAD_0(in=none; out=float) = 34
  194. {
  195.     movl L1,O1
  196. }
  197.  
  198. insn FLOAD_1(in=none; out=float) = 35
  199. {
  200.     movl L1,O1
  201. }
  202.  
  203. insn FLOAD_2(in=none; out=float) = 36
  204. {
  205.     movl L1,O1
  206. }
  207.  
  208. insn FLOAD_3(in=none; out=float) = 37
  209. {
  210.     movl L1,O1
  211. }
  212.  
  213. insn DLOAD_0(in=none; out=double) = 38
  214. {
  215.     movl L2,O1 
  216.     movl L1,O2
  217. }
  218.  
  219. insn DLOAD_1(in=none; out=double) = 39
  220. {
  221.     movl L2,O1 
  222.     movl L1,O2
  223. }
  224.  
  225. insn DLOAD_2(in=none; out=double) = 40
  226. {
  227.     movl L2,O1 
  228.     movl L1,O2
  229. }
  230.  
  231. insn DLOAD_3(in=none; out=double) = 41
  232. {
  233.     movl L2,O1 
  234.     movl L1,O2
  235. }
  236.  
  237. insn ALOAD_0(in=none; out=objref) = 42
  238. {
  239.     movl L1,O1
  240. }
  241.  
  242. insn ALOAD_1(in=none; out=objref) = 43
  243. {
  244.     movl L1,O1
  245. }
  246.  
  247. insn ALOAD_2(in=none; out=objref) = 44
  248. {
  249.     movl L1,O1
  250. }
  251.  
  252. insn ALOAD_3(in=none; out=objref) = 45
  253. {
  254.     movl L1,O1
  255. }
  256.  
  257. insn IALOAD(in=int,objref; out=int) = 46
  258. {
  259.     movl V1(I2,I1,4),O1
  260. }
  261.  
  262. insn LALOAD(in=int,objref; out=long) = 47
  263. {
  264.     leal V1(I2,I1,4),O2 
  265.     movl (O2),O1 
  266.     movl 4(O2),O2
  267. }
  268.  
  269. insn FALOAD(in=int,objref; out=float) = 48
  270. {
  271.     movl V1(I2,I1,4),O1
  272. }
  273.  
  274. insn DALOAD(in=int,objref; out=double) = 49
  275. {
  276.     leal V1(I2,I1,4),O2 
  277.     movl (O2),O1 
  278.     movl 4(O2),O2
  279. }
  280.  
  281. insn AALOAD(in=int,objref; out=objref) = 50
  282. {
  283.     movl V1(I2,I1,4),O1
  284. }
  285.  
  286. insn BALOAD(in=int,objref; out=int) = 51
  287. {
  288.     movsbl V1(I2,I1,1),O1
  289. }
  290.  
  291. insn CALOAD(in=int,objref; out=int) = 52
  292. {
  293.     movzbl V1(I2,I1,1),O1
  294. }
  295.  
  296. insn SALOAD(in=int,objref; out=int) = 53
  297. {
  298.     movswl V1(I2,I1,2),O1
  299. }
  300.  
  301. insn ISTORE(in=int; out=none) = 54
  302. {
  303.     movl I1,L1
  304. }
  305.  
  306. insn LSTORE(in=long; out=none) = 55
  307. {
  308.     movl I1,L2 
  309.     movl I2,L1
  310. }
  311.  
  312. insn FSTORE(in=float; out=none) = 56
  313. {
  314.     movl I1,L1
  315. }
  316.  
  317. insn DSTORE(in=double; out=none) = 57
  318. {
  319.     movl I1,L2 
  320.     movl I2,L1
  321. }
  322.  
  323. insn ASTORE(in=objref; out=none) = 58
  324. {
  325.     movl I1,L1
  326. }
  327.  
  328. insn ISTORE_0(in=int; out=none) = 59
  329. {
  330.     movl I1,L1
  331. }
  332.  
  333. insn ISTORE_1(in=int; out=none) = 60
  334. {
  335.     movl I1,L1
  336. }
  337.  
  338. insn ISTORE_2(in=int; out=none) = 61
  339. {
  340.     movl I1,L1
  341. }
  342.  
  343. insn ISTORE_3(in=int; out=none) = 62
  344. {
  345.     movl I1,L1
  346. }
  347.  
  348. insn LSTORE_0(in=long; out=none) = 63
  349. {
  350.     movl I1,L2 
  351.     movl I2,L1
  352. }
  353.  
  354. insn LSTORE_1(in=long; out=none) = 64
  355. {
  356.     movl I1,L2 
  357.     movl I2,L1
  358. }
  359.  
  360. insn LSTORE_2(in=long; out=none) = 65
  361. {
  362.     movl I1,L2 
  363.     movl I2,L1
  364. }
  365.  
  366. insn LSTORE_3(in=long; out=none) = 66
  367. {
  368.     movl I1,L2 
  369.     movl I2,L1
  370. }
  371.  
  372. insn FSTORE_0(in=float; out=none) = 67
  373. {
  374.     movl I1,L1
  375. }
  376.  
  377. insn FSTORE_1(in=float; out=none) = 68
  378. {
  379.     movl I1,L1
  380. }
  381.  
  382. insn FSTORE_2(in=float; out=none) = 69
  383. {
  384.     movl I1,L1
  385. }
  386.  
  387. insn FSTORE_3(in=float; out=none) = 70
  388. {
  389.     movl I1,L1
  390. }
  391.  
  392. insn DSTORE_0(in=double; out=none) = 71
  393. {
  394.     movl I1,L2 
  395.     movl I2,L1
  396. }
  397.  
  398. insn DSTORE_1(in=double; out=none) = 72
  399. {
  400.     movl I1,L2 
  401.     movl I2,L1
  402. }
  403.  
  404. insn DSTORE_2(in=double; out=none) = 73
  405. {
  406.     movl I1,L2 
  407.     movl I2,L1
  408. }
  409.  
  410. insn DSTORE_3(in=double; out=none) = 74
  411. {
  412.     movl I1,L2 
  413.     movl I2,L1
  414. }
  415.  
  416. insn ASTORE_0(in=objref; out=none) = 75
  417. {
  418.     movl I1,L1
  419. }
  420.  
  421. insn ASTORE_1(in=objref; out=none) = 76
  422. {
  423.     movl I1,L1
  424. }
  425.  
  426. insn ASTORE_2(in=objref; out=none) = 77
  427. {
  428.     movl I1,L1
  429. }
  430.  
  431. insn ASTORE_3(in=objref; out=none) = 78
  432. {
  433.     movl I1,L1
  434. }
  435.  
  436. insn IASTORE(in=int,int,objref; out=none) = 79
  437. {
  438.     movl I1,V1(I3,I2,4)
  439. }
  440.  
  441. insn LASTORE(in=long,int,objref; out=none) = 80
  442. {
  443.     movl I1,V1(I4,I3,8) 
  444.     movl I2,V2(I4,I3,8)
  445. }
  446.  
  447. insn FASTORE(in=float,int,objref; out=none) = 81
  448. {
  449.     movl I1,V1(I3,I2,4)
  450. }
  451.  
  452. insn DASTORE(in=double,int,objref; out=none) = 82
  453. {
  454.     movl I1,V1(I4,I3,8) 
  455.     movl I2,V2(I4,I3,8)
  456. }
  457.  
  458. insn AASTORE(in=objref,int,objref; out=none) = 83
  459. {
  460.     movl I1,V1(I3,I2,4)
  461. }
  462.  
  463. insn BASTORE(in=int,int,objref; out=none) = 84
  464. {
  465.     movb B1,V1(I3,I2,1)
  466. }
  467.  
  468. insn CASTORE(in=int,int,objref; out=none) = 85
  469. {
  470.     movb B1,V1(I3,I2,1)
  471. }
  472.  
  473. insn SASTORE(in=int,int,objref; out=none) = 86
  474. {
  475.     movw B1,V1(I3,I2,2)
  476. }
  477.  
  478. insn POP(in=any; out=none) = 87
  479. {
  480. }
  481.  
  482. insn POP2(in=any,any; out=none) = 88
  483. {
  484. }
  485.  
  486. insn DUP(in=any; out=any,any) = 89
  487. {
  488.     movl I1,O1
  489. }
  490.  
  491. insn DUP_X1(in=any,any; out=any,any,any) = 90
  492. {
  493.     xchgl I1,I2 
  494.     movl I2,O1
  495. }
  496.  
  497. insn DUP_X2(in=any,any,any; out=any,any,any,any) = 91
  498. {
  499.     xchgl I1,I2 
  500.     xchgl I2,I3 
  501.     movl I3,O1
  502. }
  503.  
  504. insn DUP2(in=any,any; out=any,any,any,any) = 92
  505. {
  506.     movl I1,O1 
  507.     movl I2,O2
  508. }
  509.  
  510. #
  511. # Really this instruction has 5 outputs rather than 4 but we don't
  512. #  have enough register on the i386 to do it like that.
  513. #
  514. insn DUP2_X1(in=any,any,any; out=any,any,any,any) = 93
  515. {
  516.     pushl I2 
  517.     movl I1,O1 
  518.     xchgl I3,I1 
  519.     xchgl I1,I2
  520. }
  521.  
  522. #
  523. # Really this instruction has 6 outputs rather than 4 but we don't
  524. #  have enough register on the i386 to do it like that.
  525. #
  526. insn DUP2_X2(in=any,any,any,any; out=any,any,any,any) = 94
  527. {
  528.     pushl I2 
  529.     pushl I1
  530. }
  531.  
  532. insn SWAP(in=any,any; out=any,any) = 95
  533. {
  534.     xchgl I1,O1
  535. }
  536.  
  537. insn IADD(in=int,int; out=int) = 96
  538. {
  539.     addl I1,O1
  540. }
  541.  
  542. insn LADD(in=long,long; out=long) = 97
  543. {
  544.     addl I1,O1 
  545.     adcl I2,O2
  546. }
  547.  
  548. insn FADD(in=float,float; out=float; sync) = 98
  549. {
  550.     flds S1 
  551.     fadds S2 
  552.     fstps S2 
  553.     addl 4,%esp
  554. }
  555.  
  556. insn DADD(in=double,double; out=double; sync) = 99
  557. {
  558.     fldl S1 
  559.     faddl S3 
  560.     fstpl S3 
  561.     addl 8,%esp
  562. }
  563.  
  564. insn ISUB(in=int,int; out=int) = 100
  565. {
  566.     subl I1,O1
  567. }
  568.  
  569. insn LSUB(in=long,long; out=long) = 101
  570. {
  571.     subl I1,O1 
  572.     sbbl I2,O2
  573. }
  574.  
  575. insn FSUB(in=float,float; out=float; sync) = 102
  576. {
  577.     flds S1 
  578.     fsubs S2 
  579.     fstps S2 
  580.     addl 4,%esp
  581. }
  582.  
  583. insn DSUB(in=double,double; out=double; sync) = 103
  584. {
  585.     fldl S1 
  586.     fsubl S3 
  587.     fstpl S3 
  588.     addl 8,%esp
  589. }
  590.  
  591. insn IMUL(in=int,int; out=int) = 104
  592. {
  593.     imull I1,O1
  594. }
  595.  
  596. insn LMUL(in=long,long; out=long; soft) = 105
  597. {
  598.     call _soft_lmul 
  599.     addl 8,%esp
  600. }
  601.  
  602. insn FMUL(in=float,float; out=float; sync) = 106
  603. {
  604.     flds S1 
  605.     fmuls S2 
  606.     fstps S2 
  607.     addl 4,%esp
  608. }
  609.  
  610. insn DMUL(in=double,double; out=double; sync) = 107
  611. {
  612.     fldl S1 
  613.     fmull S3 
  614.     fstpl S3 
  615.     addl 8,%esp
  616. }
  617.  
  618. insn IDIV(in=int,int; out=int; sync) = 108
  619. {
  620.     popl %ebx 
  621.     popl %eax 
  622.     movl %eax,%edx 
  623.     sarl 31,%edx 
  624.     idivl %eax,%ebx 
  625.     pushl %eax
  626. }
  627.  
  628. insn LDIV(in=long,long; out=long; soft) = 109
  629. {
  630.     call _soft_ldiv 
  631.     addl 8,%esp
  632. }
  633.  
  634. insn FDIV(in=float,float; out=float; sync) = 110
  635. {
  636.     flds S1 
  637.     fdivs S2 
  638.     fstps S2 
  639.     addl 4,%esp
  640. }
  641.  
  642. insn DDIV(in=double,double; out=double; sync) = 111
  643. {
  644.     fldl S1 
  645.     fdivl S3 
  646.     fstpl S3 
  647.     addl 8,%esp
  648. }
  649.  
  650. insn IREM(in=int,int; out=int; sync) = 112
  651. {
  652.     popl %ebx 
  653.     popl %eax 
  654.     movl %eax,%edx 
  655.     sarl 31,%edx 
  656.     idivl %eax,%ebx 
  657.     pushl %edx
  658. }
  659.  
  660. insn LREM(in=long,long; out=long; soft) = 113
  661. {
  662.     call _soft_lrem 
  663.     addl 8,%esp
  664. }
  665.  
  666. insn FREM(in=float,float; out=float; soft) = 114
  667. {
  668.     call _soft_frem 
  669.     addl 4,%esp
  670. }
  671.  
  672. insn DREM(in=double,double; out=double; soft) = 115
  673. {
  674.     call _soft_drem 
  675.     addl 8,%esp
  676. }
  677.  
  678. insn INEG(in=int; out=int) = 116
  679. {
  680.     negl O1
  681. }
  682.  
  683. insn LNEG(in=long; out=long) = 117
  684. {
  685.     negl O1 
  686.     adcl 0,O2 
  687.     negl O2
  688. }
  689.  
  690. insn FNEG(in=float; out=float; sync) = 118
  691. {
  692.     fldz 
  693.     fsubs S1 
  694.     fstps S1
  695. }
  696.  
  697. insn DNEG(in=double; out=double; sync) = 119
  698. {
  699.     fldz 
  700.     fsubl S1 
  701.     fstpl S1
  702. }
  703.  
  704. insn ISHL(in=int,int; out=int; sync) = 120
  705. {
  706.     popl %ecx 
  707.     sall %ecx,S1
  708. }
  709.  
  710. insn LSHL(in=long,int; out=long; soft) = 121
  711. {
  712.     call _soft_lshl 
  713.     addl 4,%esp
  714. }
  715.  
  716. insn ISHR(in=int,int; out=int; sync) = 122
  717. {
  718.     popl %ecx 
  719.     sarl %ecx,S1
  720. }
  721.  
  722. insn LSHR(in=long,int; out=long; soft) = 123
  723. {
  724.     call _soft_lshr 
  725.     addl 4,%esp
  726. }
  727.  
  728. insn IUSHR(in=int,int; out=int; sync) = 124
  729. {
  730.     popl %ecx 
  731.     shrl %ecx,S1
  732. }
  733.  
  734. insn LUSHR(in=long,int; out=long; soft) = 125
  735. {
  736.     call _soft_lushr 
  737.     addl 4,%esp
  738. }
  739.  
  740. insn IAND(in=int,int; out=int) = 126
  741. {
  742.     andl I1,O1
  743. }
  744.  
  745. insn LAND(in=long,long; out=long) = 127
  746. {
  747.     andl I1,O1 
  748.     andl I2,O2
  749. }
  750.  
  751. insn IOR(in=int,int; out=int) = 128
  752. {
  753.     orl I1,O1
  754. }
  755.  
  756. insn LOR(in=long,long; out=long) = 129
  757. {
  758.     orl I1,O1 
  759.     orl I2,O2
  760. }
  761.  
  762. insn IXOR(in=int,int; out=int) = 130
  763. {
  764.     xorl I1,O1
  765. }
  766.  
  767. insn LXOR(in=long,long; out=long) = 131
  768. {
  769.     xorl I1,O1 
  770.     xorl I2,O2
  771. }
  772.  
  773. insn IINC(in=none; out=none) = 132
  774. {
  775.     addl V2,L1
  776. }
  777.  
  778. insn I2L(in=int; out=long) = 133
  779. {
  780.     movl I1,O1 
  781.     sarl 31,O2
  782. }
  783.  
  784. insn I2F(in=int; out=float; sync) = 134
  785. {
  786.     filds S1 
  787.     fstps S1
  788. }
  789.  
  790. insn I2D(in=int; out=double; sync) = 135
  791. {
  792.     filds S1 
  793.     subl 4,%esp 
  794.     fstpl S1
  795. }
  796.  
  797. insn L2I(in=long; out=int) = 136
  798. {
  799.     movl I1,O1
  800. }
  801.  
  802. insn L2F(in=long; out=float; sync) = 137
  803. {
  804.     fildd S1 
  805.     addl 4,%esp 
  806.     fstps S1
  807. }
  808.  
  809. insn L2D(in=long; out=double; sync) = 138
  810. {
  811.     fildd S1 
  812.     fstpl S1
  813. }
  814.  
  815. insn F2I(in=float; out=int; sync) = 139
  816. {
  817.     flds S1 
  818.     fistps S1
  819. }
  820.  
  821. insn F2L(in=float; out=long; sync) = 140
  822. {
  823.     flds S1 
  824.     subl 4,%esp 
  825.     fistpl S1
  826. }
  827.  
  828. insn F2D(in=float; out=double; sync) = 141
  829. {
  830.     flds S1 
  831.     subl 4,%esp 
  832.     fstpl S1
  833. }
  834.  
  835. insn D2I(in=double; out=int; sync) = 142
  836. {
  837.     fldl S1 
  838.     addl 4,%esp 
  839.     fistps S1
  840. }
  841.  
  842. insn D2L(in=double; out=long; sync) = 143
  843. {
  844.     fldl S1 
  845.     fistpl S1
  846. }
  847.  
  848. insn D2F(in=double; out=float; sync) = 144
  849. {
  850.     fldl S1 
  851.     addl 4,%esp 
  852.     fstps S1
  853. }
  854.  
  855. insn INT2BYTE(in=int; out=int) = 145
  856. {
  857.     movsbl B1,O1
  858. }
  859.  
  860. insn INT2CHAR(in=int; out=int) = 146
  861. {
  862.     andl 255,O1
  863. }
  864.  
  865. insn INT2SHORT(in=int; out=int) = 147
  866. {
  867.     movswl W1,O1
  868. }
  869.  
  870. insn LCMP(in=long,long; out=int; soft) = 148
  871. {
  872.     call _soft_lcmp 
  873.     addl 12,%esp
  874. }
  875.  
  876. insn FCMPL(in=float,float; out=int; soft) = 149
  877. {
  878.     call _soft_fcmpl 
  879.     addl 4,%esp
  880. }
  881.  
  882. insn FCMPG(in=float,float; out=int; soft) = 150
  883. {
  884.     call _soft_fcmpg 
  885.     addl 4,%esp
  886. }
  887.  
  888. insn DCMPL(in=double,double; out=int; soft) = 151
  889. {
  890.     call _soft_dcmpl 
  891.     addl 12,%esp
  892. }
  893.  
  894. insn DCMPG(in=double,double; out=int; soft) = 152
  895. {
  896.     call _soft_dcmpg 
  897.     addl 12,%esp
  898. }
  899.  
  900. insn IFEQ(in=int; out=none) = 153
  901. {
  902.     cmpl 0,I1 
  903.     je J
  904. }
  905.  
  906. insn IFNE(in=int; out=none) = 154
  907. {
  908.     cmpl 0,I1 
  909.     jne J
  910. }
  911.  
  912. insn IFLT(in=int; out=none) = 155
  913. {
  914.     cmpl 0,I1 
  915.     jlt J
  916. }
  917.  
  918. insn IFGE(in=int; out=none) = 156
  919. {
  920.     cmpl 0,I1 
  921.     jge J
  922. }
  923.  
  924. insn IFGT(in=int; out=none) = 157
  925. {
  926.     cmpl 0,I1 
  927.     jgt J
  928. }
  929.  
  930. insn IFLE(in=int; out=none) = 158
  931. {
  932.     cmpl 0,I1 
  933.     jle J
  934. }
  935.  
  936. insn IF_ICMPEQ(in=int,int; out=none) = 159
  937. {
  938.     cmpl I1,I2 
  939.     je J
  940. }
  941.  
  942. insn IF_ICMPNE(in=int,int; out=none) = 160
  943. {
  944.     cmpl I1,I2 
  945.     jne J
  946. }
  947.  
  948. insn IF_ICMPLT(in=int,int; out=none) = 161
  949. {
  950.     cmpl I1,I2 
  951.     jlt J
  952. }
  953.  
  954. insn IF_ICMPGE(in=int,int; out=none) = 162
  955. {
  956.     cmpl I1,I2 
  957.     jge J
  958. }
  959.  
  960. insn IF_ICMPGT(in=int,int; out=none) = 163
  961. {
  962.     cmpl I1,I2 
  963.     jgt J
  964. }
  965.  
  966. insn IF_ICMPLE(in=int,int; out=none) = 164
  967. {
  968.     cmpl I1,I2 
  969.     jle J
  970. }
  971.  
  972. insn IF_ACMPEQ(in=objref,objref; out=none) = 165
  973. {
  974.     cmpl I1,I2 
  975.     je J
  976. }
  977.  
  978. insn IF_ACMPNE(in=objref,objref; out=none) = 166
  979. {
  980.     cmpl I1,I2 
  981.     jne J
  982. }
  983.  
  984. insn GOTO(in=none; out=none) = 167
  985. {
  986.     jmpl J
  987. }
  988.  
  989. insn JSR(in=none; out=int; sync) = 168
  990. {
  991.     call J
  992. }
  993.  
  994. insn RET(in=none; out=none; sync) = 169
  995. {
  996.     pushl L1 
  997.     ret
  998. }
  999.  
  1000. insn TABLESWITCH(in=int; out=none; sync) = 170
  1001. {
  1002.     popl %eax
  1003.     movl V1,%ebx
  1004.     subl V2,%eax
  1005.     cmpl V3,%eax
  1006.     skipb1
  1007.     movl V3,%eax
  1008.     movl 0(%ebx,%eax,4),%eax
  1009.     jmpl *%eax
  1010. }
  1011.  
  1012. insn LOOKUPSWITCH(in=int; out=none; sync) = 171
  1013. {
  1014.     popl %eax
  1015.     movl V1,%edx
  1016.     movl V2,%ebx
  1017.     movl (%ebx),%ecx
  1018.     cmpl %eax,%ecx
  1019.     skipeq3
  1020.     subl 8,%ebx
  1021.     cmpl %ebx,%edx
  1022.     skipneback5
  1023.     movl 4(%ebx),%eax
  1024.     jmpl *%eax
  1025. }
  1026.  
  1027. insn IRETURN(in=int; out=none; sync) = 172
  1028. {
  1029. +    if (i->value[0] != 0) {
  1030.         movl L1,%eax
  1031.         pushl %eax
  1032.         call _soft_monitorexit
  1033.         addl 4,%esp
  1034. +    }
  1035. +    else if (i->value[1] != 0) {
  1036.         pushl V2
  1037.         call _soft_monitorexit
  1038.         addl 4,%esp
  1039. +    }
  1040.     popl %eax
  1041.     movl %ebp,%esp 
  1042.     popl %ebp 
  1043.     ret
  1044. }
  1045.  
  1046. insn LRETURN(in=long; out=none; sync) = 173
  1047. {
  1048. +    if (i->value[0] != 0) {
  1049.         movl L1,%eax
  1050.         pushl %eax
  1051.         call _soft_monitorexit
  1052.         addl 4,%esp
  1053. +    }
  1054. +    else if (i->value[1] != 0) {
  1055.         pushl V2
  1056.         call _soft_monitorexit
  1057.         addl 4,%esp
  1058. +    }
  1059.     popl %eax
  1060.     popl %edx
  1061.     movl %ebp,%esp 
  1062.     popl %ebp 
  1063.     ret
  1064. }
  1065.  
  1066. insn FRETURN(in=float; out=none; sync) = 174
  1067. {
  1068. +    if (i->value[0] != 0) {
  1069.         movl L1,%eax
  1070.         pushl %eax
  1071.         call _soft_monitorexit
  1072.         addl 4,%esp
  1073. +    }
  1074. +    else if (i->value[1] != 0) {
  1075.         pushl V2
  1076.         call _soft_monitorexit
  1077.         addl 4,%esp
  1078. +    }
  1079.     popl %eax
  1080.     movl %ebp,%esp 
  1081.     popl %ebp 
  1082.     ret
  1083. }
  1084.  
  1085. insn DRETURN(in=double; out=none; sync) = 175
  1086. {
  1087. +    if (i->value[0] != 0) {
  1088.         movl L1,%eax
  1089.         pushl %eax
  1090.         call _soft_monitorexit
  1091.         addl 4,%esp
  1092. +    }
  1093. +    else if (i->value[1] != 0) {
  1094.         pushl V2
  1095.         call _soft_monitorexit
  1096.         addl 4,%esp
  1097. +    }
  1098.     popl %eax
  1099.     popl %ebx
  1100.     movl %ebp,%esp 
  1101.     popl %ebp 
  1102.     ret
  1103. }
  1104.  
  1105. insn ARETURN(in=objref; out=none; sync) = 176
  1106. {
  1107. +    if (i->value[0] != 0) {
  1108.         movl L1,%eax
  1109.         pushl %eax
  1110.         call _soft_monitorexit
  1111.         addl 4,%esp
  1112. +    }
  1113. +    else if (i->value[1] != 0) {
  1114.         pushl V2
  1115.         call _soft_monitorexit
  1116.         addl 4,%esp
  1117. +    }
  1118.     popl %eax
  1119.     movl %ebp,%esp 
  1120.     popl %ebp 
  1121.     ret
  1122. }
  1123.  
  1124. insn RETURN(in=none; out=none; sync) = 177
  1125. {
  1126. +    if (i->value[0] != 0) {
  1127.         movl L1,%eax
  1128.         pushl %eax
  1129.         call _soft_monitorexit
  1130. +    }
  1131. +    else if (i->value[1] != 0) {
  1132.         pushl V2
  1133.         call _soft_monitorexit
  1134.         addl 4,%esp
  1135. +    }
  1136.     movl %ebp,%esp 
  1137.     popl %ebp 
  1138.     ret
  1139. }
  1140.  
  1141. insn GETSTATIC(in=none; out=none; sync) = 178
  1142. {
  1143. +    abort(); /* Unused - see quick versions */
  1144. }
  1145.  
  1146. insn PUTSTATIC(in=none; out=none; sync) = 179
  1147. {
  1148. +    abort(); /* Unused - see quick versions */
  1149. }
  1150.  
  1151. insn GETFIELD(in=none; out=none; sync) = 180
  1152. {
  1153. +    abort(); /* Unused - see quick versions */
  1154. }
  1155.  
  1156. insn PUTFIELD(in=none; out=none; sync) = 181
  1157. {
  1158. +    abort(); /* Unused - see quick versions */
  1159. }
  1160.  
  1161. #
  1162. # Virtual method invocation uses a cache of methods.  When an invoke is
  1163. # done we check the tag (the method name) and if it matches invoke the
  1164. # cached method.  If no match, we call the soft function to perform the
  1165. # mapping.  We assume %esi will be saved by the soft function.
  1166. # This is slower than direct virtual function calls but means we do not
  1167. # have to generate all possible methods before hand, allowing them to
  1168. # be generated on cache misses.
  1169. #
  1170. insn INVOKEVIRTUAL(in=none; out=none; sync) = 182
  1171. {
  1172.     movl V1(%esp),%ebx
  1173.     movl (%ebx),%esi
  1174.     cmpl V4,V2(%esi)
  1175. +    /* skipeq5 is a magic instruction specifically written to skip
  1176. +       the next five instructions in these particular circumstances. */
  1177.     skipeq5
  1178.     pushl V4
  1179.     pushl %esi
  1180.     call _soft_lookupmethod
  1181.     popl %esi
  1182.     addl 4,%esp
  1183.     movl V3(%esi),%ebx
  1184.     call *%ebx
  1185.     addl V5,%esp
  1186. +    if (i->value[7] == 1) {
  1187.         pushl %eax
  1188. +    }
  1189. +    else if (i->value[7] == 2) {
  1190.         pushl %edx
  1191.         pushl %eax
  1192. +    }
  1193. }
  1194.  
  1195. insn INVOKENONVIRTUAL(in=none; out=none; sync) = 183
  1196. {
  1197.     movl V1,%esi
  1198.     cmpl V4,V2(%esi)
  1199.     skipeq5
  1200.     pushl V4
  1201.     pushl %esi
  1202.     call _soft_lookupmethod
  1203.     popl %esi
  1204.     addl 4,%esp
  1205.     movl V3(%esi),%ebx
  1206.     call *%ebx
  1207.     addl V5,%esp
  1208. +    if (i->value[7] == 1) {
  1209.         pushl %eax
  1210. +    }
  1211. +    else if (i->value[7] == 2) {
  1212.         pushl %edx
  1213.         pushl %eax
  1214. +    }
  1215. }
  1216.  
  1217. insn INVOKESTATIC(in=none; out=none; sync) = 184
  1218. {
  1219.     movl V1,%esi
  1220.     cmpl V4,V2(%esi)
  1221.     skipeq5
  1222.     pushl V4
  1223.     pushl %esi
  1224.     call _soft_lookupmethod
  1225.     popl %esi
  1226.     addl 4,%esp
  1227.     movl V3(%esi),%ebx
  1228.     call *%ebx
  1229.     addl V5,%esp
  1230. +    if (i->value[7] == 1) {
  1231.         pushl %eax
  1232. +    }
  1233. +    else if (i->value[7] == 2) {
  1234.         pushl %edx
  1235.         pushl %eax
  1236. +    }
  1237. }
  1238.  
  1239. insn INVOKEINTERFACE(in=none; out=none; sync) = 185
  1240. {
  1241.     movl V1(%esp),%ebx
  1242.     movl (%ebx),%esi
  1243.     cmpl V4,V2(%esi)
  1244.     skipeq5
  1245.     pushl V4
  1246.     pushl %esi
  1247.     call _soft_lookupmethod
  1248.     popl %esi
  1249.     addl 4,%esp
  1250.     movl V3(%esi),%ebx
  1251.     call *%ebx
  1252.     addl V5,%esp
  1253. +    if (i->value[7] == 1) {
  1254.         pushl %eax
  1255. +    }
  1256. +    else if (i->value[7] == 2) {
  1257.         pushl %edx
  1258.         pushl %eax
  1259. +    }
  1260. }
  1261.  
  1262. insn NEW(in=none; out=objref; soft) = 187
  1263. {
  1264.     pushl V1 
  1265.     call _soft_new
  1266. }
  1267.  
  1268. insn NEWARRAY(in=int; out=objref; soft) = 188
  1269. {
  1270.     pushl V1
  1271.     call _soft_newarray
  1272.     addl 4,%esp
  1273. }
  1274.  
  1275. insn ANEWARRAY(in=int; out=objref; soft) = 189
  1276. {
  1277.     pushl V1
  1278.     call _soft_anewarray
  1279.     addl 4,%esp
  1280. }
  1281.  
  1282. insn ARRAYLENGTH(in=objref; out=int) = 190
  1283. {
  1284.     movl V1(I1),O1
  1285. }
  1286.  
  1287. insn ATHROW(in=objref; out=none; soft) = 191
  1288. {
  1289.     call _soft_athrow
  1290. }
  1291.  
  1292. insn CHECKCAST(in=objref; out=objref; soft) = 192
  1293. {
  1294.     pushl V1 
  1295.     call _soft_checkcast 
  1296.     addl 4,%esp
  1297. }
  1298.  
  1299. insn INSTANCEOF(in=objref; out=int; soft) = 193
  1300. {
  1301.     pushl V1 
  1302.     call _soft_instanceof 
  1303.     addl 4,%esp
  1304. }
  1305.  
  1306. insn MONITORENTER(in=objref; out=none; soft) = 194
  1307. {
  1308.     call _soft_monitorenter
  1309.     addl 4,%esp
  1310. }
  1311.  
  1312. insn MONITOREXIT(in=objref; out=none; soft) = 195
  1313. {
  1314.     call _soft_monitorexit
  1315.     addl 4,%esp
  1316. }
  1317.  
  1318. insn WIDE(in=none; out=none) = 196
  1319. {
  1320. }
  1321.  
  1322. insn MULTIANEWARRAY(in=none; out=objref; soft) = 197
  1323. {
  1324.     pushl V1 
  1325.     pushl V2 
  1326.     call _soft_multianewarray
  1327.     addl V3,%esp
  1328. }
  1329.  
  1330. insn IFNULL(in=objref; out=none) = 198
  1331. {
  1332.     cmpl 0,I1 
  1333.     je J
  1334. }
  1335.  
  1336. insn IFNONNULL(in=objref; out=none) = 199
  1337. {
  1338.     cmpl 0,I1 
  1339.     jne J
  1340. }
  1341.  
  1342. insn GOTO_W(in=none; out=none) = 200
  1343. {
  1344.     jmpl J
  1345. }
  1346.  
  1347. insn JSR_W(in=none; out=none; sync) = 201
  1348. {
  1349.     call J
  1350. }
  1351.  
  1352. insn BREAKPOINT(in=none; out=none) = 202
  1353. {
  1354.     brkpt
  1355. }
  1356.  
  1357. insn RET_W(in=none; out=none; soft) = 210
  1358. {
  1359.     call _soft_unimplemented
  1360. }
  1361.  
  1362. insn GETSTATIC_QUICK(in=none; out=any) = 248
  1363. {
  1364.     movl (V1),O1
  1365. }
  1366.  
  1367. insn GETSTATIC2_QUICK(in=none; out=any,any) = 249
  1368. {
  1369.     movl (V1),O1 
  1370.     movl (V2),O2
  1371. }
  1372.  
  1373. insn PUTSTATIC_QUICK(in=any; out=none) = 250
  1374. {
  1375.     movl I1,(V1)
  1376. }
  1377.  
  1378. insn PUTSTATIC2_QUICK(in=any,any; out=none) = 251
  1379. {
  1380.     movl I1,(V1)
  1381.     movl I2,(V2)
  1382. }
  1383.  
  1384. insn GETFIELD_QUICK(in=objref; out=any) = 252
  1385. {
  1386.     movl V1(I1),O1
  1387. }
  1388.  
  1389. insn GETFIELD2_QUICK(in=objref; out=any,any) = 253
  1390. {
  1391.     movl V1(I1),O1 
  1392.     movl V2(I1),O2
  1393. }
  1394.  
  1395. insn PUTFIELD_QUICK(in=objref,any; out=none) = 254
  1396. {
  1397.     movl I1,V1(I2)
  1398. }
  1399.  
  1400. insn PUTFIELD2_QUICK(in=objref,any,any; out=none) = 255
  1401. {
  1402.     movl I1,V1(I3)
  1403.     movl I2,V2(I3)
  1404. }
  1405.  
  1406. #
  1407. # Register definitions.
  1408. #
  1409. reg %eax int = 0;
  1410. reg %ecx int = 1;
  1411. reg %edx int = 2;
  1412. reg %ebx int = 3;
  1413.